<template>
  <div>
    <el-card class="mb20" shadow="never">
      <scheme-form @search="handleSearch" ref="schemeForm" />
    </el-card>
    <el-card shadow="never">
      <div class="mb10" style="text-align: right">
        <el-tooltip class="item" effect="dark" content="新增考评方案" placement="top">
          <el-button
            v-if="$auth('satisfaction:add')"
            size="small"
            icon="el-icon-plus"
            type="primary"
            @click="handleAdd"
          />
        </el-tooltip>
      </div>
      <scheme-list ref="schemeList" />
    </el-card>
  </div>
</template>

<script>
import SchemeForm from './SchemeForm'
import SchemeList from './SchemeList'
export default {
  components: {
    SchemeForm,
    SchemeList
  },
  methods: {
    handleSearch(param) {
      this.$refs.schemeList.getPlanList(param)
    },
    handleAdd() {
      this.$router.push({
        name: 'satisfactionCreateScheme',
        params: { type: 'add' }
      })
    }
    // handleEdit(type, row) {
    //   this.$refs.planModal.edit(type, row)
    // }
  }
}
</script>

<style>
</style>